/'
	===================================================================================
	
		fbregexp - FreeBASIC Regular Expressions Library
		
		http://code.google.com/p/fbregexp/
	
	-----------------------------------------------------------------------------------
	
		version history: 
			
			0.1 - first release
	
	
		author: 
			
			Aleksandar Ruzicic (krckoorascic@gmail.com)
	
	
	-----------------------------------------------------------------------------------
	
		Copyright (c) 2008 Aleksandar Ruzicic
	
		Permission is hereby granted, free of charge, to any person obtaining a copy
		of this software and associated documentation files (the "Software"), to deal
		in the Software without restriction, including without limitation the rights
		to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
		copies of the Software, and to permit persons to whom the Software is
		furnished to do so, subject to the following conditions:
		
		The above copyright notice and this permission notice shall be included in
		all copies or substantial portions of the Software.
		
		THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
		IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
		FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
		AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
		LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
		OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
		THE SOFTWARE. 

	===================================================================================
'/

Namespace FB
		
	Enum Boolean
		False = 0
		True 	= Not False
	End Enum
	
	
	Type Match
		FirstIndex	As Integer
		Length		As Integer
		Value			As Integer
	End Type
	
	
	Type Matches
		
		Public:
			
			Declare Property Count As Integer
			
			Declare Property Item(Index As Integer) As Match
			Declare Property Item(Index As Integer, m As Match)
			
			Declare Sub Add(m As Match)
			Declare Sub Clear
			
			Declare Destructor
		
		Private:
		
			iSize		As Integer = 0
			iCount	As Integer = 0
			pItem		As Match Pointer
			
	End Type
	
	
	Type RegExp
		
		Public:
		
			Declare Constructor(	sPattern As String = "", _
										bIgnoreCase As Boolean = False, _
										bGlobal As Boolean = False, _
										bMultiline As Boolean = False _
									 )
			Declare Destructor
			
			Declare Property Pattern As String
			Declare Property Pattern(value As String)
			
			Declare Property IgnoreCase As Boolean
			Declare Property IgnoreCase(value As Boolean)
			
			Declare Property Global As Boolean
			Declare Property Global(value As Boolean)
			
			Declare Property Multiline As Boolean
			Declare Property Multiline(value As Boolean)
			
			Declare Function Test(inputString As String) As Boolean
			
			Declare Function Replace(searchString As String, replaceString As String) As String
			
			Declare Sub Execute(searchString As String, ByRef colMatches As Matches)
		
		
		Private:
			
			Declare Function Compile As Boolean
		
			s_Pattern		As String
			b_IgnoreCase	As Boolean
			b_Global			As Boolean
			b_Multiline		As Boolean
			
			bCompiled		As Boolean = False
			reCompiler		As RegExpLib.Compiler Pointer = 0
		
	End Type
	
End Namespace